//
//  CommentTableViewHeadView.m
//  TodatPlay
//
//  Created by dllo on 16/9/5.
//  Copyright © 2016年 DM.C. All rights reserved.
//

#import "CommentTableViewHeadView.h"
#import "SDAutoLayout.h"


@interface CommentTableViewHeadView ()
@property (nonatomic, strong) UIImageView *heartImageView;
@property (nonatomic, strong) UILabel *praiseLabel;

@end

@implementation CommentTableViewHeadView
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createHeadView];
    }
    return self;
}
- (void)createHeadView {
    self.backgroundColor = [UIColor colorWithWhite:0.957 alpha:1.000];
    self.heartImageView = [UIImageView new];
    self.likeUserNameLabel = [UILabel new];
    self.praiseLabel = [UILabel new];
    [self addSubview:self.heartImageView];
    [self addSubview:self.likeUserNameLabel];
    [self addSubview:self.praiseLabel];
    
    self.heartImageView.image = [UIImage imageNamed:@"index_jilu_love_s"];
    self.heartImageView.sd_layout
    .leftSpaceToView(self, 10)
    .topSpaceToView(self, 5)
    .widthIs(25)
    .heightIs(25);
    
    self.likeUserNameLabel.text = @"xxxxxx";
    self.likeUserNameLabel.font = [UIFont systemFontOfSize:13];
    self.likeUserNameLabel.textColor = [UIColor colorWithRed:0.000 green:0.314 blue:0.984 alpha:1.000];
    
    self.praiseLabel.text = @"赞";
    self.praiseLabel.textColor = [UIColor colorWithRed:0.000 green:0.314 blue:0.984 alpha:1.000];
    self.praiseLabel.font = [UIFont systemFontOfSize:13];
    
    self.likeUserNameLabel.sd_layout
    .leftSpaceToView(self.heartImageView, 3)
    .centerYEqualToView(self.heartImageView)
    .rightSpaceToView(self, 5)
    .autoHeightRatio(0);
    
    self.praiseLabel.sd_layout
    .leftSpaceToView(self.likeUserNameLabel, 10)
    .centerYEqualToView(self.likeUserNameLabel)
    .heightIs(30)
    .widthIs(15);
    [self setupAutoHeightWithBottomView:self.likeUserNameLabel bottomMargin:10];
    
}




@end
